<div class="bg-light lter b-b wrapper-md ng-scope">
    <h4 class="m-n font-thin">会员卡交易管理</h4>
</div>
<div class="wrapper-md ng-scope">
    <div class="panel-body panel panel-default no-border b-1 b-r b-b">
        <div ng-controller="memberTransactionHistoryCtrl">
            <div class="bg-light panel-body m-b">
                <p class="text-center text-muted">汇总数据更新时间 {{headerData.time | date:'yyyy-MM-dd HH:mm:ss' }}</p>
                <div>
                    <div class="col-sm-4">
                        <div class="text-center">
                            <p class="h2 m-b-xs">{{headerData.totalTimes==null?'0':headerData.totalTimes}}</p>
                            <p>累计交易次数</p>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="text-center">
                            <p class="h2 m-b-xs">{{headerData.totalUsers==null?'0':headerData.totalUsers}}</p>
                            <p>累计交易人数</p>
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="text-center">
                            <p class="h2 m-b-xs">¥ {{headerData.totalMoney==null?'0.00':headerData.totalMoney | number:2}}</p>
                            <p>累计交易金额</p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-default m-n">
                <div class="row wrapper">
                    <div class="col-sm-9">
                        <form class="form-inline ng-pristine ng-valid">
                            <div class="form-group">
                                <label class="control-label">交易时间</label>
                                <div class="input-group" ng-controller="DatepickerDemoCtrl">
                                    <div class="input-group no-padder m-n w-lg">
                                        <input type="text" class="form-control input-sm" placeholder="请输入开始日期" uib-datepicker-popup="yyyy-MM-dd" datepicker-popup="yyyy-MM-dd" ng-model="memberCardHistoryVO.startTime"  max-date="maxDate"
                                               alt-input-formats="altInputFormats" is-open="opened" datepicker-options="dateOptions" close-text="关闭" clear-text="清空" current-text="今天" initialDate disabled/>
                                        <span class="input-group-btn ">
                                            <button type="button" class="input-sm btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                                        </span>
                                    </div>
                                </div>
                                <div class="input-group" ng-controller="DatepickerDemoCtrl">
                                    <div class="input-group no-padder m-n w-lg">
                                        <input type="text" class="form-control input-sm" placeholder="请输入结束日期" uib-datepicker-popup="yyyy-MM-dd" datepicker-popup="yyyy-MM-dd" ng-model="memberCardHistoryVO.endTime" min-date="memberCardHistoryVO.startTime" max-date="maxDate"
                                               alt-input-formats="altInputFormats" is-open="opened" datepicker-options="dateOptions" close-text="关闭" clear-text="清空" current-text="今天" initialDate disabled/>
                                        <span class="input-group-btn ">
                                            <button type="button" class="input-sm btn btn-default" ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                                        </span>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label">交易编号</label>
                                <input type="text" class="input-sm form-control" ng-model="memberCardHistoryVO.transactionNumber">
                            </div>
                            <div class="form-group">
                                <label class="control-label">会员编号</label>
                                <input type="text" class="input-sm form-control" ng-model="memberCardHistoryVO.cardNumber">
                            </div>
                            <div class="form-group">
                                <label class="control-label h6">状态</label>
                                <select class="input-sm form-control" ng-model="memberCardHistoryVO.status">
                                    <option value>全部</option>
                                    <option value="0">未支付</option>
                                    <option value="1">已支付</option>
                                </select>
                            </div>
                            <button class="btn btn-sm btn-default" ng-click="queryForList()">查询</button>
                        </form>
                    </div>
                </div>
                <div class="table-responsive">
                    <table class="table table-striped b-t b-light">
                        <thead>
                        <tr>
                            <th>交易时间</th>
                            <th>会员信息</th>
                            <th>会员卡名称</th>
                            <th>交易单号</th>
                            <th>状态</th>
                            <th>交易金额(元)</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in list">
                            <td>{{item.createdTime}}</td>
                            <td>
                                <span>编号：{{item.cardNumber}}<br></span>
                                <span ng-if="item.name!=null">姓名：{{item.name}}<br></span>
                                <span ng-if="item.mobilePhone!=null">手机号码：{{item.mobilePhone}}</span>
                            </td>
                            <td>
                                <span ng-if="item.state == 0">{{item.cardName}}(已失效)</span>
                                <span ng-if="item.state == 1">{{item.cardName}}</span>
                            </td>
                            <td>
                                <span ng-if="item.status == 0">暂无</span>
                                <span ng-if="item.status == 1">{{item.transactionNumber}}</span>
                            </td>
                            <td>
                                <span class="label bg-warning" ng-if="item.status == 0">未支付</span>
                                <span class="label bg-success" ng-if="item.status == 1">已支付</span>
                            </td>
                            <td>
                                <span>{{item.price | number:2}}</span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <div ng-if="list.length<=0 && !app.loading" class="padder-v text-center">
                        <span class="h6">~未搜索到任何数据~</span>
                    </div>
                    <div>
                        <circle-loading ng-if="app.loading"></circle-loading>
                    </div>
                </div>
                <footer class="panel-footer">
                    <div class="row">
                        <div class="col-sm-offset-4 col-sm-4 text-center">
                            <small class="text-muted inline m-t-sm m-b-sm">显示第 {{startRow}} 至 {{endRow}} 项结果，共 {{totalItems}} 项</small>
                        </div>
                        <div class="col-sm-4 text-right text-center-xs">
                            <pagination boundary-links="true" total-items="totalItems" ng-model="currentPage"
                                        ng-change="pageChanged()" max-size="{{maxPageRow}}" class="pagination-sm m-t-none m-b"
                                        previous-text="上一页" next-text="下一页"
                                        first-text="首页" last-text="尾页"></pagination>
                        </div>
                    </div>
                </footer>
            </div>
        </div>
    </div>
</div>